//***************************************************************************
//  NARS2000 -- Token To Syntax Object Header
//***************************************************************************

/***************************************************************************
    NARS2000 -- An Experimental APL Interpreter
    Copyright (C) 2006-2014 Sudley Place Software

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
***************************************************************************/

typedef struct tagTOKEN_SO
{
    TOKEN_TYPES tkType;             // Token
    SO_ENUM     tkSynObj;           // Matching Syntax Object
} TOKEN_SO, *LPTOKEN_SO;

// The following struc includes only those tokens that are generated by the Tokenizer
// Token to Syntax Object mapping
EXTERN
TOKEN_SO tokenSo[]
#ifdef DEFINE_VALUES
=
{{TKT_UNUSED        , soNONE },
 {TKT_VARNAMED      , soA    },
 {TKT_CHRSTRAND     , soA    },
 {TKT_NUMSTRAND     , soA    },
 {TKT_NUMSCALAR     , soA    },
 {TKT_VARIMMED      , soA    },
 {TKT_ASSIGN        , soSP   },
 {TKT_LISTSEP       , soSEMI },
 {TKT_LABELSEP      , soEOS  },
 {TKT_COLON         , soNONE },         // ??
 {TKT_FCNIMMED      , soF    },
 {TKT_OP1IMMED      , soMOP  },
 {TKT_OP2IMMED      , soDOP  },
 {TKT_OP3IMMED      , soHY   },
 {TKT_OPJOTDOT      , soJD   },
 {TKT_LEFTPAREN     , soLP   },
 {TKT_RIGHTPAREN    , soRP   },
 {TKT_LEFTBRACKET   , soLBK  },
 {TKT_RIGHTBRACKET  , soRBK  },
 {TKT_LEFTBRACE     , soLBC  },
 {TKT_RIGHTBRACE    , soRBC  },
 {TKT_EOS           , soEOS  },
 {TKT_EOL           , soEOS  },
 {TKT_SOS           , soNONE },         // ??
 {TKT_LINECONT      , soNONE },         // ??
 {TKT_INPOUT        , soIO   },
 {TKT_VARARRAY      , soA    },
 {TKT_CS_ANDIF      , soCS1  },
 {TKT_CS_ASSERT     , soCS1  },
 {TKT_CS_CASE       , soCS1  },
 {TKT_CS_CASELIST   , soCS1  },
 {TKT_CS_CONTINUE   , soCS0  },
 {TKT_CS_CONTINUEIF , soCS1  },
 {TKT_CS_ELSE       , soCS0  },
 {TKT_CS_ELSEIF     , soCS1  },
 {TKT_CS_END        , soCS0  },
 {TKT_CS_ENDFOR     , soCS0  },
 {TKT_CS_ENDFORLCL  , soCS0  },
 {TKT_CS_ENDIF      , soEOS  },
 {TKT_CS_ENDREPEAT  , soCS0  },
 {TKT_CS_ENDSELECT  , soEOS  },
 {TKT_CS_ENDWHILE   , soCS0  },
 {TKT_CS_FOR        , soCSF  },
 {TKT_CS_FOR2       , soCS0  },
 {TKT_CS_FORLCL     , soCSF  },
 {TKT_CS_GOTO       , soCS1  },
 {TKT_CS_IF         , soCS1  },
 {TKT_CS_IF2        , soCS0  },
 {TKT_CS_IN         , soCSI  },
 {TKT_CS_LEAVE      , soCS0  },
 {TKT_CS_LEAVEIF    , soCS1  },
 {TKT_CS_ORIF       , soCS1  },
 {TKT_CS_REPEAT     , soCS0  },
 {TKT_CS_REPEAT2    , soCS0  },
 {TKT_CS_RETURN     , soCS0  },
 {TKT_CS_SELECT     , soCS1  },
 {TKT_CS_SELECT2    , soCS0  },
 {TKT_CS_UNTIL      , soCS1  },
 {TKT_CS_WHILE      , soCS1  },
 {TKT_CS_WHILE2     , soCS0  },
 {TKT_CS_SKIPCASE   , soCS0  },
 {TKT_CS_SKIPEND    , soCS0  },
 {TKT_SYS_NS        , soSYSN },
 {TKT_SYNTERR       , soSYNR },
 {TKT_SETALPHA      , soCS0  },
 {TKT_DEL           , soF    },
 {TKT_DELDEL        , soNONE },         // Could be MOPN, DOP or DOPN
 {TKT_DELAFO        , soF    },
 {TKT_FCNAFO        , soF    },
 {TKT_OP1AFO        , soMOP  },
 {TKT_OP2AFO        , soDOP  },
 {TKT_GLBDFN        , soNONE },         // ??
 {TKT_NOP           , soNONE },         // ??
 {TKT_AFOGUARD      , soAFOG },
 {TKT_AFORETURN     , soAFOR },
 {TKT_STRAND        , soSA   },
 {TKT_LISTINT       , soNONE },         // ??
 {TKT_LISTPAR       , soNONE },         // ??
 {TKT_LSTIMMED      , soNONE },         // ??
 {TKT_LSTARRAY      , soNONE },         // ??
 {TKT_LSTMULT       , soNONE },         // ??
 {TKT_FCNARRAY      , soF    },
 {TKT_FCNNAMED      , soF    },
 {TKT_AXISIMMED     , soA    },
 {TKT_AXISARRAY     , soA    },
 {TKT_OP1NAMED      , soMOP  },
 {TKT_OP2NAMED      , soDOP  },
 {TKT_OP3NAMED      , soHY   },
 {TKT_STRNAMED      , soNONE },         // ??
 {TKT_CS_NEC        , soNONE },         // ??
 {TKT_CS_EOL        , soNONE },         // ??
 {TKT_CS_ENS        , soNONE },         // ??
 {TKT_FILLJOT       , soNF   },
}
#endif
;


// Count the # entries so we can measure against it
EXTERN
UINT tokenSoLen
#ifdef DEFINE_VALUES
= countof (tokenSo)
#endif
;


//***************************************************************************
//  End of File: tokenso.h
//***************************************************************************
